package com.ks.composestudy.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.google.accompanist.pager.ExperimentalPagerApi
import com.google.accompanist.pager.HorizontalPager
import com.ks.composestudy.MainViewModel

@OptIn(ExperimentalPagerApi::class)
@Composable
fun Home(viewModel: MainViewModel) {
    Column {
        HorizontalPager(1, Modifier.weight(1f)) {
            when (it) {
                0 -> ChatList(viewModel.chats)
            }
        }
        BottomBar(viewModel.selectedTab) {
            viewModel.selectedTab = it
        }
    }
}